package org.spider.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 行政区划表
 * </p>
 *
 * @author lzy
 * @since 2022-06-02 15:36:47
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("spider_manage_region")
@ApiModel(value = "SpiderManageRegionEntity对象", description = "行政区划表")
public class SpiderManageRegionEntity extends Model<SpiderManageRegionEntity> {

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("区划编号")
    @TableField("`code`")
    private String code;

    @ApiModelProperty("父区划编号")
    @TableField("parent_code")
    private String parentCode;

    @ApiModelProperty("祖区划编号")
    @TableField("ancestors")
    private String ancestors;

    @ApiModelProperty("区划名称")
    @TableField("`name`")
    private String name;

    @ApiModelProperty("省级区划编号")
    @TableField("province_code")
    private String provinceCode;

    @ApiModelProperty("省级名称")
    @TableField("province_name")
    private String provinceName;

    @ApiModelProperty("市级区划编号")
    @TableField("city_code")
    private String cityCode;

    @ApiModelProperty("市级名称")
    @TableField("city_name")
    private String cityName;

    @ApiModelProperty("区级区划编号")
    @TableField("district_code")
    private String districtCode;

    @ApiModelProperty("区级名称")
    @TableField("district_name")
    private String districtName;

    @ApiModelProperty("镇级区划编号")
    @TableField("town_code")
    private String townCode;

    @ApiModelProperty("镇级名称")
    @TableField("town_name")
    private String townName;

    @ApiModelProperty("村级区划编号")
    @TableField("village_code")
    private String villageCode;

    @ApiModelProperty("村级名称")
    @TableField("village_name")
    private String villageName;

    @ApiModelProperty("层级")
    @TableField("`level`")
    private Integer level;

    @ApiModelProperty("备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
